#ifndef __STDTCP_H_
#define __STDTCP_H_

#include <stddef.h>
#include <stdbool.h>

struct StdTcpServer;
typedef struct StdTcpServer TcpS;

TcpS* InitTcpServer(const char *ip,unsigned short port);
int Accept(TcpS *s);
bool TcpServerRecv(int clientSock,void *ptr,size_t size);
bool TcpServerSend(int clientSock,void *ptr,size_t size);
void ClearTcpServer(TcpS *s);


struct StdTcpClient;
typedef struct StdTcpClient TcpC;

TcpC* InitTcpClient(const char *ServerIp,unsigned short ServerPort);
bool TcpClientRecv(TcpC *c,void *ptr,size_t size);
bool TcpClientSend(TcpC *c,void *ptr,size_t size);
void ClearTcpClient(TcpS *c);

#endif